(function($, window) {
	var baseRequest = window.baseRequest;
	var appConfig = window.appConfig;
	var commonTool = window.commonTool;
	var dataManager = window.dataManager;
	var baseUrl = appConfig.v3ServiceUrl + '/devlogserver';

	var v3DevlogServer = window.v3DevlogServer = {};

	//add by wangyu
	var eQuipMentLog = baseUrl + '/getdevlogs?';
	v3DevlogServer.getEquipMentLog = function(devSN, starttime, endtime, page, callback){
		baseRequest.commonPost(eQuipMentLog, {
			COUNT: 1,
			DATA: 1,
			action: 1,
			devSN: devSN,
			starttime: starttime,
			endtime: endtime,
			limit: 10,
			tab: page
		}, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.retCode != 0) {
					callback(1);
				} else {
					callback(0, data.message);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var danger = baseUrl + '/getlogstats?';
	v3DevlogServer.getDanger = function(devSN, startTime, endTime, callback){
		baseRequest.commonGet(danger + $.param({
			devSN : devSN,
			startTime : startTime,
			endTime : endTime
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data.logstats);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	//end

	//add by wuchengcheng

	//end

})(mui, window);